provide a toggle button to temporarily disable position recording in the
authorTim Janik <timj@gtk.org>
Sun, 5 Nov 2000 05:08:05 +0000 (05:08 +0000)
committerTim Janik <timj@src.gnome.org>
Sun, 5 Nov 2000 05:08:05 +0000 (05:08 +0000)
Sun Nov  5 05:32:39 2000  Tim Janik  <timj@gtk.org>

        * gtk/testgtk.c (uposition_stop_configure): provide a toggle
        button to temporarily disable position recording in the
        "saved position" test.

Sat Nov  4 05:37:17 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkthemes.c: added compat code that temporarily implements
        GtkThemeEnginePlugin as a GObject exporting GTypePlugin. this is
        going to be revamped by owen's upcoming GtkModule patches, but
        untill then people want gtk to build, right? ;)

12 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkobject.c
gtk/gtksignal.c
gtk/gtkthemes.c
gtk/testgtk.c
tests/testgtk.c

index d467096e9821a12e1107e5cb27e63fcd772f627e..a1d0f47ebb45ce625d205b2321c5578aa697bb46 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Sun Nov  5 05:32:39 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/testgtk.c (uposition_stop_configure): provide a toggle
+       button to temporarily disable position recording in the
+       "saved position" test.
+
+Sat Nov  4 05:37:17 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkthemes.c: added compat code that temporarily implements
+       GtkThemeEnginePlugin as a GObject exporting GTypePlugin. this is
+       going to be revamped by owen's upcoming GtkModule patches, but
+       untill then people want gtk to build, right? ;)
+
 2000-11-04  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkenums.h: remove trailing comma from GtkDeleteType member
index d467096e9821a12e1107e5cb27e63fcd772f627e..a1d0f47ebb45ce625d205b2321c5578aa697bb46 100644 (file)
@@ -1,3 +1,16 @@
+Sun Nov  5 05:32:39 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/testgtk.c (uposition_stop_configure): provide a toggle
+       button to temporarily disable position recording in the
+       "saved position" test.
+
+Sat Nov  4 05:37:17 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkthemes.c: added compat code that temporarily implements
+       GtkThemeEnginePlugin as a GObject exporting GTypePlugin. this is
+       going to be revamped by owen's upcoming GtkModule patches, but
+       untill then people want gtk to build, right? ;)
+
 2000-11-04  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkenums.h: remove trailing comma from GtkDeleteType member
index d467096e9821a12e1107e5cb27e63fcd772f627e..a1d0f47ebb45ce625d205b2321c5578aa697bb46 100644 (file)
@@ -1,3 +1,16 @@
+Sun Nov  5 05:32:39 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/testgtk.c (uposition_stop_configure): provide a toggle
+       button to temporarily disable position recording in the
+       "saved position" test.
+
+Sat Nov  4 05:37:17 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkthemes.c: added compat code that temporarily implements
+       GtkThemeEnginePlugin as a GObject exporting GTypePlugin. this is
+       going to be revamped by owen's upcoming GtkModule patches, but
+       untill then people want gtk to build, right? ;)
+
 2000-11-04  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkenums.h: remove trailing comma from GtkDeleteType member
index d467096e9821a12e1107e5cb27e63fcd772f627e..a1d0f47ebb45ce625d205b2321c5578aa697bb46 100644 (file)
@@ -1,3 +1,16 @@
+Sun Nov  5 05:32:39 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/testgtk.c (uposition_stop_configure): provide a toggle
+       button to temporarily disable position recording in the
+       "saved position" test.
+
+Sat Nov  4 05:37:17 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkthemes.c: added compat code that temporarily implements
+       GtkThemeEnginePlugin as a GObject exporting GTypePlugin. this is
+       going to be revamped by owen's upcoming GtkModule patches, but
+       untill then people want gtk to build, right? ;)
+
 2000-11-04  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkenums.h: remove trailing comma from GtkDeleteType member
index d467096e9821a12e1107e5cb27e63fcd772f627e..a1d0f47ebb45ce625d205b2321c5578aa697bb46 100644 (file)
@@ -1,3 +1,16 @@
+Sun Nov  5 05:32:39 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/testgtk.c (uposition_stop_configure): provide a toggle
+       button to temporarily disable position recording in the
+       "saved position" test.
+
+Sat Nov  4 05:37:17 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkthemes.c: added compat code that temporarily implements
+       GtkThemeEnginePlugin as a GObject exporting GTypePlugin. this is
+       going to be revamped by owen's upcoming GtkModule patches, but
+       untill then people want gtk to build, right? ;)
+
 2000-11-04  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkenums.h: remove trailing comma from GtkDeleteType member
index d467096e9821a12e1107e5cb27e63fcd772f627e..a1d0f47ebb45ce625d205b2321c5578aa697bb46 100644 (file)
@@ -1,3 +1,16 @@
+Sun Nov  5 05:32:39 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/testgtk.c (uposition_stop_configure): provide a toggle
+       button to temporarily disable position recording in the
+       "saved position" test.
+
+Sat Nov  4 05:37:17 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkthemes.c: added compat code that temporarily implements
+       GtkThemeEnginePlugin as a GObject exporting GTypePlugin. this is
+       going to be revamped by owen's upcoming GtkModule patches, but
+       untill then people want gtk to build, right? ;)
+
 2000-11-04  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkenums.h: remove trailing comma from GtkDeleteType member
index d467096e9821a12e1107e5cb27e63fcd772f627e..a1d0f47ebb45ce625d205b2321c5578aa697bb46 100644 (file)
@@ -1,3 +1,16 @@
+Sun Nov  5 05:32:39 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/testgtk.c (uposition_stop_configure): provide a toggle
+       button to temporarily disable position recording in the
+       "saved position" test.
+
+Sat Nov  4 05:37:17 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkthemes.c: added compat code that temporarily implements
+       GtkThemeEnginePlugin as a GObject exporting GTypePlugin. this is
+       going to be revamped by owen's upcoming GtkModule patches, but
+       untill then people want gtk to build, right? ;)
+
 2000-11-04  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkenums.h: remove trailing comma from GtkDeleteType member
index 47c606de952fd02f529cb89319f9cb2d61baffd2..c1df707cb8344a44816a61ca05413579e41e446c 100644 (file)
@@ -232,7 +232,7 @@ gtk_object_shutdown (GObject *gobject)
 static void
 gtk_object_real_destroy (GtkObject *object)
 {
-  _g_signal_handlers_destroy (G_OBJECT (object));
+  g_signal_handlers_destroy (G_OBJECT (object));
 }
 
 static void
index 219680dc13244061b582224f070ef2b60daec6dc..e399423e2065f0c298a87585fdaf248eda978a79 100644 (file)
@@ -173,8 +173,8 @@ gtk_signal_compat_matched (GtkObject       *object,
     }
   
   if (!n_handlers)
-    g_warning ("unable to find signal handler for object(%p) with func(%p) and data(%p)",
-              object, func, data);
+    g_warning ("unable to find signal handler for object(%s:%p) with func(%p) and data(%p)",
+              G_OBJECT_TYPE_NAME (object), object, func, data);
 }
 
 static inline gboolean
index 61b7fc182155935a2436175169647f7617063e29..dc10495400cd64c5f8d5b125d7fba780494fead2 100644 (file)
 #include "config.h"
 #include "gtkintl.h"
 
+/*****************************
+ *****************************
+ * temporary compat code, make GtkThemeEnginePlugin a GObject plus GTypePlugin interface
+ */
 typedef struct _GtkThemeEnginePlugin GtkThemeEnginePlugin;
+typedef struct _GObjectClass         GtkThemeEnginePluginClass;
+static void gtk_theme_engine_plugin_use                (GTypePlugin     *plugin);
+static void gtk_theme_engine_plugin_unuse              (GTypePlugin     *plugin);
+static void gtk_theme_engine_plugin_complete_type_info (GTypePlugin     *plugin,
+                                                       GType            g_type,
+                                                       GTypeInfo       *info,
+                                                       GTypeValueTable *value_table);
+GType      gtk_theme_engine_plugin_get_type           (void);
+struct _GtkThemeEnginePlugin
+{
+  GObject parent_instance;
+
+  GtkThemeEngine *engine;
+  gchar *engine_name;
+  GTypeInfo info;
+  GType type;
+  GType parent_type;
+};
+#define GTK_TYPE_THEME_ENGINE_PLUGIN              (gtk_theme_engine_plugin_get_type ())
+#define GTK_THEME_ENGINE_PLUGIN(plugin)           (G_TYPE_CHECK_INSTANCE_CAST ((plugin), GTK_TYPE_THEME_ENGINE_PLUGIN, GtkThemeEnginePlugin))
+#define GTK_THEME_ENGINE_PLUGIN_CLASS(class)      (G_TYPE_CHECK_CLASS_CAST ((class), GTK_TYPE_THEME_ENGINE_PLUGIN, GtkThemeEnginePluginClass))
+#define GTK_IS_THEME_ENGINE_PLUGIN(plugin)        (G_TYPE_CHECK_INSTANCE_TYPE ((plugin), GTK_TYPE_THEME_ENGINE_PLUGIN))
+#define GTK_IS_THEME_ENGINE_PLUGIN_CLASS(class)   (G_TYPE_CHECK_CLASS_TYPE ((class), GTK_TYPE_THEME_ENGINE_PLUGIN))
+#define GTK_THEME_ENGINE_PLUGIN_GET_CLASS(plugin) (G_TYPE_INSTANCE_GET_CLASS ((plugin), GTK_TYPE_THEME_ENGINE_PLUGIN, GtkThemeEnginePluginClass))
+static void
+gtk_theme_engine_plugin_shutdown (GObject *object)
+{
+  GtkThemeEnginePlugin *plugin = GTK_THEME_ENGINE_PLUGIN (object);
+
+  g_warning (G_STRLOC ": shutdown should never happen for static type plugins");
+
+  g_object_ref (object);
+
+  /* chain parent class handler */
+  G_OBJECT_CLASS (g_type_class_peek_parent (GTK_THEME_ENGINE_PLUGIN_GET_CLASS (plugin)))->shutdown (object);
+}
+static void
+gtk_theme_engine_plugin_class_init (GtkThemeEnginePluginClass *class)
+{
+  GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+
+  gobject_class->shutdown = gtk_theme_engine_plugin_shutdown;
+}
+static void
+theme_engine_plugin_iface_init (GTypePluginClass *iface)
+{
+  iface->use_plugin = gtk_theme_engine_plugin_use;
+  iface->unuse_plugin = gtk_theme_engine_plugin_unuse;
+  iface->complete_type_info = gtk_theme_engine_plugin_complete_type_info;
+}
+GType
+gtk_theme_engine_plugin_get_type (void)
+{
+  static GType theme_engine_plugin_type = 0;
+
+  if (!theme_engine_plugin_type)
+    {
+      static const GTypeInfo theme_engine_plugin_info = {
+       sizeof (GtkThemeEnginePluginClass),
+       NULL,           /* base_init */
+       NULL,           /* base_finalize */
+       (GClassInitFunc) gtk_theme_engine_plugin_class_init,
+       NULL,           /* class_finalize */
+       NULL,           /* class_data */
+       sizeof (GtkThemeEnginePlugin),
+       0,              /* n_preallocs */
+       NULL,           /* instance_init */
+      };
+      static const GInterfaceInfo iface_info = {
+       (GInterfaceInitFunc) theme_engine_plugin_iface_init,
+       NULL,               /* interface_finalize */
+       NULL,               /* interface_data */
+      };
+
+      theme_engine_plugin_type = g_type_register_static (G_TYPE_OBJECT, "GtkThemeEnginePlugin", &theme_engine_plugin_info, 0);
+
+      g_type_add_interface_static (theme_engine_plugin_type, G_TYPE_TYPE_PLUGIN, &iface_info);
+    }
+
+  return theme_engine_plugin_type;
+}
+/* end of GtkThemeEnginePlugin object implementation stuff
+ *****************************
+ *****************************/
 
 struct _GtkThemeEngine
 {
@@ -54,17 +142,6 @@ struct _GtkThemeEngine
   guint refcount;
 };
 
-struct _GtkThemeEnginePlugin
-{
-  GTypePlugin plugin;
-
-  GtkThemeEngine *engine;
-  gchar *engine_name;
-  GTypeInfo info;
-  GType type;
-  GType parent_type;
-};
-
 static GHashTable *engine_hash = NULL;
 
 #ifdef __EMX__
@@ -217,9 +294,9 @@ gtk_theme_engine_create_rc_style (GtkThemeEngine *engine)
 }
 
 static void
-gtk_theme_engine_plugin_ref (GTypePlugin *plugin)
+gtk_theme_engine_plugin_use (GTypePlugin *plugin)
 {
-  GtkThemeEnginePlugin *theme_plugin = (GtkThemeEnginePlugin *)plugin;
+  GtkThemeEnginePlugin *theme_plugin = GTK_THEME_ENGINE_PLUGIN (plugin);
 
   if (theme_plugin->engine == NULL)
     {
@@ -237,9 +314,9 @@ gtk_theme_engine_plugin_ref (GTypePlugin *plugin)
 }
 
 static void
-gtk_theme_engine_plugin_unref (GTypePlugin *plugin)
+gtk_theme_engine_plugin_unuse (GTypePlugin *plugin)
 {
-  GtkThemeEnginePlugin *theme_plugin = (GtkThemeEnginePlugin *)plugin;
+  GtkThemeEnginePlugin *theme_plugin = GTK_THEME_ENGINE_PLUGIN (plugin);
 
   g_return_if_fail (theme_plugin->engine != NULL);
   
@@ -247,23 +324,16 @@ gtk_theme_engine_plugin_unref (GTypePlugin *plugin)
 }
                               
 static void
-gtk_theme_engine_complete_type_info (GTypePlugin     *plugin,
-                                    GType            g_type,
-                                    GTypeInfo       *info,
-                                    GTypeValueTable *value_table)
+gtk_theme_engine_plugin_complete_type_info (GTypePlugin     *plugin,
+                                           GType            g_type,
+                                           GTypeInfo       *info,
+                                           GTypeValueTable *value_table)
 {
-  GtkThemeEnginePlugin *theme_plugin = (GtkThemeEnginePlugin *)plugin;
+  GtkThemeEnginePlugin *theme_plugin = GTK_THEME_ENGINE_PLUGIN (plugin);
 
   *info = theme_plugin->info;
 }
 
-static GTypePluginVTable gtk_theme_engine_plugin_vtable = {
-  gtk_theme_engine_plugin_ref,
-  gtk_theme_engine_plugin_unref,
-  gtk_theme_engine_complete_type_info,
-  NULL
-};
-
 /**
  * gtk_theme_engine_register_type:
  * @engine:      a #GtkThemeEngine
@@ -296,16 +366,15 @@ gtk_theme_engine_register_type (GtkThemeEngine  *engine,
 
   type = g_type_from_name (type_name);
   if (type)
-    plugin = (GtkThemeEnginePlugin *)g_type_get_plugin (type);
+    plugin = GTK_THEME_ENGINE_PLUGIN (g_type_get_plugin (type));
   else
     {
-      plugin = g_new (GtkThemeEnginePlugin, 1);
+      plugin = g_object_new (GTK_TYPE_THEME_ENGINE_PLUGIN, NULL);
 
-      plugin->plugin.vtable = &gtk_theme_engine_plugin_vtable;
       plugin->engine = NULL;
       plugin->engine_name = NULL;
       plugin->parent_type = parent_type;
-      plugin->type = g_type_register_dynamic (parent_type, type_name, (GTypePlugin *) plugin, 0);
+      plugin->type = g_type_register_dynamic (parent_type, type_name, G_TYPE_PLUGIN (plugin), 0);
     }
   
   if (plugin->engine)
index b714be3690c8799fdef78b5f96f6dee3b8124e61..126cf04aa1a1be26a2fd93de6af673d01bc4108d 100644 (file)
@@ -2265,6 +2265,16 @@ uposition_configure (GtkWidget *window)
   return FALSE;
 }
 
+static void
+uposition_stop_configure (GtkToggleButton *toggle,
+                         GtkObject       *window)
+{
+  if (toggle->active)
+    gtk_signal_handler_block_by_func (window, uposition_configure, NULL);
+  else
+    gtk_signal_handler_unblock_by_func (window, uposition_configure, NULL);
+}
+
 static void
 create_saved_position (void)
 {
@@ -2304,6 +2314,12 @@ create_saved_position (void)
                        "GtkContainer::border_width", 10,
                        "GtkWidget::parent", main_vbox,
                        "GtkWidget::visible", TRUE,
+                       "child", gtk_widget_new (GTK_TYPE_TOGGLE_BUTTON,
+                                                "label", "Stop Events",
+                                                "active", FALSE,
+                                                "signal::clicked", uposition_stop_configure, window,
+                                                "visible", TRUE,
+                                                NULL),
                        NULL);
 
       hbox = gtk_hbox_new (FALSE, 0);
index b714be3690c8799fdef78b5f96f6dee3b8124e61..126cf04aa1a1be26a2fd93de6af673d01bc4108d 100644 (file)
@@ -2265,6 +2265,16 @@ uposition_configure (GtkWidget *window)
   return FALSE;
 }
 
+static void
+uposition_stop_configure (GtkToggleButton *toggle,
+                         GtkObject       *window)
+{
+  if (toggle->active)
+    gtk_signal_handler_block_by_func (window, uposition_configure, NULL);
+  else
+    gtk_signal_handler_unblock_by_func (window, uposition_configure, NULL);
+}
+
 static void
 create_saved_position (void)
 {
@@ -2304,6 +2314,12 @@ create_saved_position (void)
                        "GtkContainer::border_width", 10,
                        "GtkWidget::parent", main_vbox,
                        "GtkWidget::visible", TRUE,
+                       "child", gtk_widget_new (GTK_TYPE_TOGGLE_BUTTON,
+                                                "label", "Stop Events",
+                                                "active", FALSE,
+                                                "signal::clicked", uposition_stop_configure, window,
+                                                "visible", TRUE,
+                                                NULL),
                        NULL);
 
       hbox = gtk_hbox_new (FALSE, 0);